//菜单列表      模型

//引入mongoose模块
const mongoose = require('mongoose');
const { Schema } = mongoose;

//创建userSchema数据库模型
const menuSchema = new Schema({
    parentId: [mongoose.Types.ObjectId],//parentId: [ null ]这种格式
    menuType: Number,
    menuName: String,
    icon: String,
    path: String,
    component: String,
    menuCode: String,
    menuState: Number,
    createTime: {
        type: Date,
        default: Date.now
    },
    updateTime: {
        type: Date,
        default: Date.now
    },
    createTime: String
});

//定义user模型并导出
module.exports = mongoose.model('menu', menuSchema)